﻿@using PagedList
@using PagedList.Mvc
@model IEnumerable<NewRen.Models.Topic>
@{
    ViewBag.Title = "主题管理";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}

<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>主题管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="/Admin/Home/Index">后台管理</a>
            </li>
            <li>
                <a>论坛管理</a>
            </li>
            <li>
                <a href="#">主题管理</a>
            </li>
        </ol>
    </div>
</div>

<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>主题列表</h5>
                </div>
                <div class="ibox-content">
                    <form class="search">
                        检索：
                        <input type="text" name="Begin" class="textbox date nullable" placeholder="发布时间(大于)" value="@Request.QueryString["Begin"]" onclick="SetDate()" />
                        <input type="text" name="End" class="textbox date nullable" placeholder="发布时间(小于)" value="@Request.QueryString["End"]" onclick="SetDate()" />
                        <input type="text" name="Key" class="textbox nullable" placeholder="关键字" />
                        <select name="PlateID" class="textbox">
                            <option value="">选择板块</option>
                            @foreach (var item in ViewBag.Plates)
                            {
                                <option value="@item.ID">@item.Title</option>
                            }
                        </select>
                        <input type="submit" class="btn btn-info" value="检索" />
                    </form>
                    <table class="table">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>名称</th>
                                <th>时间</th>
                                <th>举报数</th>
                                <th>浏览数</th>
                                <th>是否显示</th>
                                <th>是否官方认证</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model)
                            {
                                <tr id="@item.ID">
                                    <td>@item.ID</td>
                                    <td>@item.Title</td>
                                    <td>@item.Time</td>
                                    <td>@item.Report</td>
                                    <td>@item.Browses</td>
                                    <td>@item.IsShow</td>
                                    <td>@item.IsOfficeIdentified</td>
                                    <td>
                                        <a href="javascript:deleteDialog('/Admin/Bbs/TopicDelete/@item.ID?sid=@ViewBag.SID',@item.ID);">删除</a>
                                        <a href="/Admin/Bbs/TopicShow/@item.ID">详情</a>
                                        @if (!item.IsShow)
                                        {
                                            <a href="/Admin/Bbs/SetTopicShow/@item.ID?sid=@ViewBag.SID">设置展示</a>
                                        }
                                        else
                                        {
                                            <a href="/Admin/Bbs/SetTopicShow/@item.ID?sid=@ViewBag.SID">设置不展示</a>
                                        }
                                        @if (!item.IsOfficeIdentified)
                                        {
                                            <a href="/Admin/Bbs/SetTopicIdentify/@item.ID?sid=@ViewBag.SID">设置官方认证</a>
                                        }
                                        else
                                        {
                                            <a href="/Admin/Bbs/SetTopicIdentify/@item.ID?sid=@ViewBag.SID">设置不官方认证</a>
                                        }
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                    @Html.PagedListPager((IPagedList)Model, page => Url.Action("Forum", new { page = page, End = Request.QueryString["End"],Begin = Request.QueryString["Begin"],Key= Request.QueryString["Key"],PlateID= Request.QueryString["PlateID"] }))
                </div>
            </div>
        </div>
    </div>
</div>